Tightening build errors by warnings as errors and making more build time issues#1214
Merged
adamhathcock merged 28 commits intomasterfrom Feb 16, 2026
Merged
Tightening build errors by warnings as errors and making more build time issues#1214adamhathcock merged 28 commits intomasterfrom
adamhathcock merged 28 commits intomasterfrom
Conversation
…ig-errors # Conflicts: # src/SharpCompress/Common/Zip/ZipFilePart.cs # src/SharpCompress/Compressors/BZip2/BZip2Stream.cs
This was referenced Mar 4, 2026
Closed
This was referenced Mar 23, 2026
This was referenced Mar 30, 2026
This was referenced Apr 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a number of improvements to code analysis, analyzer configuration, and code quality in both the build system and main source code. The most significant changes include stricter analyzer enforcement, enhanced culture-invariant string handling, and improvements to async and memory handling in both configuration and implementation.
Analyzer configuration and enforcement:
.editorconfighave been made stricter, with several suggestions promoted to errors (e.g., culture-sensitive operations, string comparison, logging, memory allocation, and async usage). This helps enforce higher code quality and consistency across the codebase.src/, relaxed or disabled analyzers forbuild/scripts, and more lenient rules fortests/.Build and analyzer infrastructure:
<RunAnalyzersDuringLiveAnalysis>and<RunAnalyzersDuringBuild>fromDirectory.Build.props, likely to ensure analyzers always run during builds and live analysis is not explicitly disabled.Culture-invariant and string handling improvements:
build/Program.cs, allToLower()and string operations now explicitly specifyCultureInfo.InvariantCultureorStringComparison.Ordinalto avoid culture-specific bugs and improve reliability. [1] [2] [3] [4] [5]src/SharpCompress/Archives/ArchiveVolumeFactory.cs,ToString()now uses a default culture info for consistent string formatting.Async and exception handling improvements:
build/Program.cs, exception handling for git commands is now more precise, throwingInvalidOperationExceptioninstead of a genericException.ifstatements for better readability and maintainability.src/SharpCompress/Archives/GZip/GZipArchive.Async.cs, simplified async writer construction, removing unnecessary options wrapping.General code robustness:
These changes collectively improve code reliability, maintainability, and enforce higher standards for both production and test code.